<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="./js/angular-1.5.8/angular.js"></script>
</head>
<body ng-app="mainApp">
<div ng-controller="controller1">
    <input type="text" ng-model="txt"/><br/>
    <input type="text" ng-model="txt"/><br/>
</div>
<hr>
<div ng-controller="controller2">
    <input type="text" ng-model="txt"/><br/>
    <input type="text" ng-model="txt"/><br/>
</div>
</body>
<script>
    //推荐
    angular.module('mainApp.subApp1',[])
            .controller('controller1',function($scope){

            });

    angular.module('mainApp.subApp2',[])
            .controller('controller2',function($scope){

            })
    angular.module('mainApp',['mainApp.subApp1','mainApp.subApp2']);
</script>
</html>